#!/usr/bin/env perl
#
# mkrpmdir.pl - Create RPM directorioes to build packages
#

use strict;
use warnings;

my $RPMDIR = $ENV{HOME} . "/rpm";

sub mksubdirs {
    my $root = shift;
    print "Creating RPM subdirectories in $root\n";
    my @subdirs = qw(SPECS SOURCES RPMS SRPMS BUILD);
    mkdir $root;
    foreach my $subdir (@subdirs) {
	mkdir $root . '/' . $subdir;
    }
}

foreach my $dir (@ARGV) {
    mksubdirs $dir;
}
if ($#ARGV == -1) {
    mksubdirs $RPMDIR;
}
